package com.study.app;

import com.study.bean.Dog;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/15 9:58 上午
 */
public class App1 {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext1.xml");
        Object cat = ctx.getBean("cat");
        System.out.println(cat);

//        Dog dog = ctx.getBean(Dog.class);
//        System.out.println(dog);

//        Dog dog1 = ctx.getBean("dog1", Dog.class);
//        System.out.println(dog1);
        String[] beanDefinitionNames = ctx.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }

    }
}
